package ex;

import java.util.Scanner;

class ex02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的基本工资数：");
        double a = sc.nextDouble();
        double b = a * 0.08 + (a * 0.02 + 3) + a * 0.025 + a * 0.12;
        double c = a - b;
        double t = 0;
        if (c <= 8000 && c >= 5000) {
            t = 5000+(c - 5000) * (1-0.03);
        } else if (c <= 17000&&c>8000) {
            t = 5000+(c - 8000) * (1 - .001) + (8000 - 5000) * (1 - 0.03);
        } else if (c <= 30000&&c>17000) {
            t = 5000+(c - 17000) * (1 - 0.02) + (17000 - 8000) * (1 - 0.01) + (8000 - 5000) * (1 - 0.03);
        } else if (c <= 60000&&c>40000) {
            t = 5000+(t - 40000) * (1 - 0.03) + (40000 - 30000) * (1 - 0.025) + (30000-17000)*(1-0.02)+(17000 - 8000) * (1 - 0.01) + (8000 - 5000) * (1 - 0.03);
        } else if (c <= 85000&&c>60000) {
            t = 5000+(t - 60000) * (1 - 0.035) + (60000 - 40000) * (1 - 0.03) + (40000 - 30000) * (1 - 0.025) + (30000 - 17000) * (1 - 0.02) + (17000 - 8000) * (1 - 0.01) + (8000 - 5000) * (1 - 0.03);
        } else if (c > 850000) {
            t = 5000+(t - 850000) * (1 - 0.045) + (85000 - 60000) * (1 - 0.035) + (60000 - 40000) * (1 - 0.03) + (40000 - 30000) * (1 - 0.025) + (30000 - 17000) * (1 - 0.02) + (17000 - 8000) * (1 - 0.01) + (8000 - 5000) * (1 - 0.03);
        }
        System.out.println(t);
    }
}


